package algorithms.que14;

import java.awt.geom.Point2D;

/**
 * @功能
 * @创建时间 2020/8/21
 */
public class getS {
    public int max;
/*
获取最大面积
 */
    public int getMax(int[] array){
        int len=array.length;
        int tmp;
        int wid;
        int min;
        for (int i=0;i<len;i++){
            for(int j=i+1;j<len;j++){
                min=array[i]>array[j]? array[j]:array[i];
                 wid=j-i;
                 tmp=wid*min;
                 max(tmp);
            }}
        return max;
    }
    public void max(int tmp){
        this.max=this.max>tmp?max:tmp;
    }
}
class client{
    public static void main(String[] args) {

        int[] a={5,100,2,5,9,1,7};
        System.out.println(new getS().getMax(a));
    }
        }